"""
   - Tuple（元组）与列表类似，不同之处在于元组的元素不能修改
   - 元组表示多个元素组成的序列
   - 用于存储一串信息，数据之间使用","分隔
   - 元组用（）定义

"""
# 元组的创建
tuple1 = (1,2,3,4,5,"hello world",3.14,True)
print(tuple1)
print(type(tuple1))


tuple2 = (1,) # 元组中只有一个元素时，需要加一个“,”
print(type(tuple2))

tuple3 = tuple() # tuple():类型转换 其他类型->tuple
print(type(tuple3))

tuple4 = ()
print(type(tuple4))


# str --> tuple
tuple5 = tuple("hello")
print("tuple======>",type(tuple5))

# list --> tuple
tuple6 = tuple([1,2,3,4])
print("tuple======>",type(tuple6))

# tuple --> list
list1 = list(tuple6)
print(list1)

# tuple --> str
str1 = str(list1)
print("str1=====>", str1)
print(type(str1))






